<template>
	<view class="my-bg">
		
		<view class="top-info" @click="Gotoinfo">
			<image :src="data.logo" mode="" class="info-img"></image>
			<view class="info-name">
				<div>
					{{data.name}}
				</div>
				<div class="edit-btn">编辑资料
					<image src="https://admin.cqycgyl.com/uploads/20250912/71158ba8a9e716b1c183a31c0e7a6d91.png" mode="aspectFill" ></image>
				</div>
			</view>
			<!-- <view class="info-time">
				到期时间：{{data.end_time}}
			</view> -->
			<view class="top-right" @click.stop="GoPay">
				&nbsp;&nbsp;&nbsp;&nbsp;商家收款码
			</view>
		</view>
		
		<!-- <view class="today">
			<view class="today-box">
				<view class="box-top">
					今日结算金额
				</view>
				<view class="box-bottom">
					{{data.todayorderpaymoney}}
				</view>
			</view>
			<view class="today-box">
				<view class="box-top">
					历史结算金额
				</view>
				<view class="box-bottom">
					{{data.totalordershopmoney}}
				</view>
			</view>
			<view class="today-box">
				<view class="box-top">
					今日收款金额
				</view>
				<view class="box-bottom">
					{{data.todayordershopmoney}}
				</view>
			</view>
			<view class="today-box">
				<view class="box-top">
					历史收款金额
				</view>
				<view class="box-bottom">
					{{data.totalorderpaymoney}}
				</view>
			</view>
			<view class="today-box"></view>
		</view> -->
		
		<view class="money">
				<view class="money-title">
					可提现余额(元)
				</view>
				<view class="money-title-next">
					<view class="money-num">
						<text class="big">{{ String(data.shop_money).split('.')[0] || 0}}</text>
						<text class="small">.{{ String(data.shop_money).split('.')[1] ? String(data.shop_money).split('.')[1] : '00' }}</text>
					</view>
					<view class="money-bottom">
						<text class="money-btn" @click="GetMoney">
							提现
						</text>
						<text class="jilu" @click="Gotopage(1)">记录</text>
					</view>
				</view>
		</view>
		
		
		<view class="tongji">
			<view class="tj-col">
				<view class="tj-note">
					今日订单数
				</view>
				<view class="tj-title">
					{{data.todayordernum}}
				</view>
			</view>
			<view class="tj-col">
				<view class="tj-note">
					今日营业额
				</view>
				<view class="tj-title">
					<text class="big">{{ String(data.todayordershopmoney).split('.')[0] }}</text><text class="small">.{{ String(data.todayordershopmoney).split('.')[1] ? String(data.todayordershopmoney).split('.')[1] : '00' }}</text>
				</view>
				
			</view>
			<view class="tj-col">
				<view class="tj-note">
					今日结算额
				</view>
				<view class="tj-title">
					<text class="big">{{ String(data.todayorderpaymoney).split('.')[0] }}</text><text class="small">.{{ String(data.todayorderpaymoney).split('.')[1] ? String(data.todayorderpaymoney).split('.')[1] : '00' }}</text>
				</view>
				
			</view>
		</view>

		<view class="row3">
			<view class="historybar">
				<view class="his-tit">
					历史结算金额
				</view>
				<view class="his-num">
					<text class="big">{{ String(data.totalordershopmoney).split('.')[0] }}</text><text class="small">.{{ String(data.totalorderpaymoney).split('.')[1] ? String(data.totalorderpaymoney).split('.')[1] : '00' }}</text>
				</view>
			</view>
			<view class="historyincom">
				<view class="his-tit">
					历史收款额
				</view>
				<view class="his-num">
					<text class="big">{{ String(data.totalorderpaymoney).split('.')[0] }}</text><text class="small">.{{ String(data.totalorderpaymoney).split('.')[1] ? String(data.totalorderpaymoney).split('.')[1] : '00' }}</text>
				</view>
			</view>
		</view>
		<view class="bottm">
			<view class="bottom-box" @click="Gotopage(4)">
				<image src="https://admin.cqycgyl.com/uploads/20250912/5fd1fd2c6fd8cff502bf312bf68b2761.png" mode="" class="box-img"></image>
				<view class="box-topsp">
					商品管理
				</view>
			</view>
			
		
		</view>
		<view class="bottm">
			<view class="bottom-box" @click="Gotopage(1)">
				<image src="https://admin.cqycgyl.com/uploads/20250912/2f2e453b0a4326fa5b877159ae67d27e.png" mode="" class="box-img"></image>
				<view class="box-topsp">
					收款订单
				</view>
			</view>
			
		
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				BarTop:'',
				BarHeight:'',
				data: {
					todayorderpaymoney: 0.00,
					totalordershopmoney: 0.00,
					todayordershopmoney: 0.00,
					totalorderpaymoney: 0.00,
					totalordernum: 0,
					totalcouponlog: 0
				}
			}
		},
		onLoad() {
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			   this.BarTop = menuButtonInfo.top;
			   this.BarHeight = menuButtonInfo.height;
		},
		onShow() {
			this.$u.api.shop.GetStoreInfo().then(res =>{
				if(res.code == 200){
					this.data = res.data
				}
			})
		},
		methods:{
			GoPay(){
				uni.navigateTo({
					// url:`./Pay?id=${this.data.record_id}`
					url:`./Pay?shop_name=${this.data.name}&shop_id=${this.data.shop_id}`
				})
			},
			Gotoinfo(){
				console.log('gotoinfo')
				uni.navigateTo({
					url:'/pageA/Store/info'
				})
			},
			GetMoney(){
				console.log('getMoney')
				uni.navigateTo({
					url:'/pageA/Store/payouts'
				})
			},
			orderrecord(){
				console.log('orderrecord')
				uni.navigateTo({
					url:'/pageA/Store/Orderrecord'
				})
			},
			userlist(){
				console.log(33)
				uni.navigateTo({
					url:'/pageA/Store/Userlist'
				})
			},
			recommended(){
				console.log('recommended')
				uni.navigateTo({
					url:'./recommended'
				})
			},
			backNav(){
				uni.switchTab({
					url:'../../pages/my/index'
				})
			},
			Gotopage(index){
				
				if(index == 1){
					uni.navigateTo({
						url:'./orders'
					})
				}else if(index==4){
					console.log(this.data.shop_id)
					uni.navigateTo({
						url:'/pageA/goodsman?id='+this.data.shop_id
					})
				}
				else{
					uni.navigateTo({
						url:'./record'
					})
				}
			}
		}
	}
	
</script>

<style>
	.my-bg{		
		background-size: 100% 550rpx;
	}

	.top-info{
		width: 710rpx;
		height: 82rpx;
		/* background-color: white; */
		margin-top: 50rpx;
		margin-left: 40rpx;
		position: relative;
		display: flex;
		align-items: center;
		padding-right: 30rpx;
		
	}
	.info-img{
		width:100rpx;
		height: 100rpx;
		border-radius: 50%;
	}
	.info-name{
		font-size: 36rpx;
		font-family: PingFang SC-Heavy;
		color: black;
		display: inline-block;
		/* border: 1rpx solid; */
		margin-left: 20rpx;
	}
	.info-time{
		font-size: 24rpx;
		font-family: PingFang SC-Medium;
		color: black;
		display: inline-block;
		position: absolute;
		bottom: 0;
		color: #636370;
		left: 100rpx;
	}
	.top-right{
		margin-left: auto;
		width: 186rpx;
		height: 54rpx;
		color: #F16325;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		display: flex;
		align-items: center;
		padding: 10rpx 16rpx;
		background : url('https://admin.cqycgyl.com/uploads/20250912/f32a05940e22fbf40355ff9173527d44.png') 16rpx center no-repeat,
		#FCEEE7;
		padding-left: 50rpx;
		background-size: 28rpx 28rpx;
		font-size: 24rpx;
	}
	.top{width: 750rpx;}
	
	.money{
		width: 690rpx;
		height: 628rpx;
		margin-top: 34rpx;
		margin-left: 30rpx;
		position: relative;
		border-radius: 24rpx;
		color: white;
		padding: 30rpx;
		background: url('https://admin.cqycgyl.com/uploads/20250912/2410a619e59457a2b3a39c45d21ec1a9.png');
		position: relative;
		z-index: 2;
		background-size: cover;		
	}

	.tongji{
		width: 690rpx;
		border-radius: 24rpx 24rpx 0 0;
		padding: 30rpx;
		display: flex;
		flex-direction: column;
		background-color: rgba(255, 255, 255, 0.85);
		align-items: center;
		margin-top: -438rpx;
		margin-left: 30rpx;		
		z-index: 3;
		position: relative;
		
	}
	.tj-col{
		position: relative;
		width: 100%;
		border-bottom: solid 1rpx #EFEFEF;
	}
	
	.tj-title{
		font-size: 36rpx;
		color: #333333;
		margin-bottom: 20rpx;
		margin-top:20rpx;
	}
	.tj-note{
		font-size: 28rpx;
		color: #999999;
	}

	.tj-note:not(:first-child){
		margin-top: 20rpx;
	}
	

	.small{
		font-size: 28rpx;
	}

	
	


	.row3{
		position: relative;
		display: flex;
		justify-content: space-between;
		background: rgba(255, 255, 255, 0.85);
		width: 690rpx;
		margin-left: 30rpx;
		border-radius: 0 0 24rpx 24rpx;
		backdrop-filter: blur(10rpx);
		z-index: 4;
		position: relative;
	}

	.historybar,.historyincom{
		width: 334rpx;
		height: 154rpx;		
		padding: 30rpx;
		position: relative;
	}


	.his-tit{
		font-size: 28rpx;
		color: #666666;
		font-weight: 400;
	}
	.his-num{
		font-size: 36rpx;
		color: #333333;
		font-weight: bold;
		margin-top: 8rpx;
	}
		

	.money-title{
		height: 40rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Medium;
		color: #ffffff;		
	}
	.money-title-next{
		display: flex;
		width: 100%;
		margin-top: 16rpx;
	}
	.money-num{
		font-size: 56rpx;
		color: #FFFFFF;
	}
	.money-bottom{
		display: flex;
		align-items: center;
		margin-left: auto;
		
	}
	.money-btn,.jilu{
		
		width: 130rpx;
		height: 60rpx;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		
	}
	.money-btn{
		background: none;
		color: #FCE3D8;
		border: solid 1rpx #FCE3D8;
	}
	.jilu{
		background: #FCE3D8;
		font-size: 28rpx;
		color: #F16325;
		margin-left: 30rpx;
	}
	

	.today{
		width: 685rpx;
		height: 322rpx;
		background: url('https://yhflsyz.oss-cn-guangzhou.aliyuncs.com/Store/Group%203781%402x.png') center/cover;
		margin-left: 31rpx;
		margin-top: -25rpx;
		/* z-index: 999; */
		display: flex;
		justify-content: space-around;
		align-items: center;
		flex-wrap: wrap;
	}
	.today-box{
		margin-top: 20rpx;
		width: 240rpx;
		height: 120rpx;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
	}
	.box-top{
		font-size: 24rpx;
		color: #515355;
		font-family: PingFang SC-Medium;
		font-weight: Medium;
	}
	.box-bottom{
		font-size: 40rpx;
		min-width: 170rpx;
		text-align: center;
		color: #0E0E0E;
		font-family: DIN-Medium-Regular;
		font-weight: Regular;
	}
	.title{
		margin-top: 65rpx;
		margin-left: 40rpx;
		font-size: 28rpx;
		font-weight: bold;
		color: #333333;
		font-family: PingFang SC-Bold;
	}
	.bottm{
		width: 690rpx;
		margin-left: 30rpx;
		margin-top: 20rpx;
		background-color: white;
		border-radius: 16rpx;
		padding: 34rpx 30rpx;
	}
	.bottom-box{
		width: 240rpx;
		position: relative;
		display: flex;
	}
	.box-img{
		width: 36rpx;
		height: 36rpx;
	}
	.box-topsp{
		width: 112rpx;
		height: 40rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #202020;
		line-height: 30rpx;
		text-align: center;
		font-style: normal;
		text-transform: none;
		margin-left: 16rpx;
	}
	
	.order-nav{width: 100%;font-size: 32rpx;font-weight: bold;text-align: center;position: fixed;color: #202020;z-index: 999;}
	.order-nav-img{width: 17rpx;height: 34rpx;position: absolute;left: 20rpx;padding: 15rpx 15rpx 15rpx 10rpx;z-index: 999;}
	.nav-sp{position: absolute;width: 100%;left: 0rpx;text-align: center;}
	.edit-btn{		
		font-weight: 400;
		font-size: 24rpx;
		color: #666666;
		display: flex;
		align-items: center;

	}
	.edit-btn>image{
		width: 32rpx;
		height: 32rpx;
	}
</style>